fix(runner): report failing lifecycle hooks consistently#838
Merged
Conversation
A failing set_up_before_script produced three different outcomes depending on incidental details: attributed failure (plain failing command), silently ignored (failing `cmd && var=x` guard on Bash 3.2 — execute_file_hook read only the ERR-trap global and discarded the hook's real exit status), or silent failures with an off-by-one count (Bash >= 4, where the ERR trap re-fired in the executor's own scope and returned before record_file_hook_failure ran). - capture the hook's real status from $? and fall back to the trap global; guard the trap's return by FUNCNAME so the executor-scope re-fire records instead of silently bailing (both hook executors) - reset the runner loop to set +euo after sourcing each file: a test file's top-level `set -euo pipefail` leaked into the loop and let a failing hook abort the whole run mid-suite with no summary - count hook-failure casualties from the file's own function list and run the #829 function cleanup on the failure path too — previously leftover functions from earlier files inflated the totals - harden two src helpers that broke callers under strict mode: is_diff_enabled read an unset var, cleanup_testcase_temp_files returned 1 on its skip path - make 13 latently strict-broken tests capture nested failures with `|| code=$?` — the loop reset makes --strict honest and deterministic, which exposed them (they already failed standalone on main) - report_json: a jq-less box now skips instead of failing the hook Closes #836 Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED
This was referenced Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #836
A failing
set_up_before_scriptproduced three different outcomes depending on the hook's last statement and the bash version — including silently ignored failures, off-by-one totals with no message, and a strict test file aborting the whole run mid-suite.💡 Changes
set -euo pipefailno longer leaks into the runner--strictexposedhttps://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED